package com.zjs.swagger2.demo.web;

import java.util.List;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.zjs.swagger2.demo.domain.User;


@RestController
@RequestMapping(value = "/Second")
public class SwaggerController2 {
	
	@RequestMapping(value = "/findByID", method = RequestMethod.POST)
	public String findByID(@RequestParam String id){
		return "findByID Swagger2   "+id;
	}
	
	@RequestMapping(value = "/findByID/{id}", method = RequestMethod.POST)
	public String findByID2(@PathVariable String id){
		return "findByID Swagger2   "+id;
	}
	
	@RequestMapping(value = "/findByIDAndName", method = RequestMethod.POST)
	public String findByIDAndName(@RequestParam String id,@RequestParam String name){
		return "findByID Swagger2   "+id+name;
	}
	
	public User findByUser(@RequestBody User user){
		return user;
	}
	   
	@RequestMapping(value = "/findByList", method = RequestMethod.POST)
	public List<User> findByList(@RequestBody List<User> list){
		return list;
	}
	
	@RequestMapping(value = "/findByIDAndUser", method = RequestMethod.POST)
	public User findByIDAndUser(@RequestParam String id,@RequestBody User user){
		user.setId(id);
		return user;
	}
	

}
